import request from '../axios/http'

//获取全部商品
export const all = params => {
    return request({
        url:'/goods/all',
        method:'get',
        params
    })
}

//搜索
export const search = params => {
    return request({
        url:'/api/search',
        method:'get',
        params
    })
}

//新建商品
export const create = params => {
    return request({
        url:'/goods/create',
        method:'post',
        data:params
    })
}

//更新商品
export const edit = params => {
    return request({
        url:'/goods/edit',
        method:'post',
        data:params
    })
}

//批量删除商品
export const del = params => {
    return request({
        url:'/goods/del',
        method:'delete',
        data:params
    })
}

//商品上下架
export const status = params => {
    return request({
        url:'/goods/status',
        method:'post',
        data:params
    })
}

//通过二级分类获取商品
export const getGoodsByCategory = params => {
    return request({
        url:'/api/getBookByCategory',
        method:'get',
        params
    })
}

